/* USER CODE BEGIN Header */
/**
  ******************************************************************************
  * @file           : flash.h
  * @brief          : Header for flash.c file.
  *                   This file contains the common defines of the application.
  * @author         : Qilong Huang <jcdiyhelp@qq.com>
  * @date           : 2021-06-11 
  ******************************************************************************
  * @attention
  *
  * Copyright (c) 2021 Joy create tech(Suzhou, China) Co., Ltd.
  * All rights reserved.
  *
  *
  ******************************************************************************
  */
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __FLASH_H
#define __FLASH_H

#ifdef __cplusplus
extern "C"
{
#endif

/* Global include ---------------------------------------------------------*/
#include "stm32l1xx.h"
#include "stm32l1xx_hal.h"
#include "global.h"


UINT8_t FLASH_ReadByte(UINT32_t Addr);
TYP_funcRetrun_t FLASH_WriteAWord(UINT32_t Addr, UINT32_t Data);
void FLASH_EraseAppArea(UINT32_t StartAddress, UINT32_t EndAddress);
void FLASH_PageErase(UINT32_t PageAddress);
volatile UINT32_t FLASH_ReadWord(UINT32_t Addr);
HAL_StatusTypeDef HAL_FLASHEx_ProgramWord(uint32_t Address, uint32_t Data);
TYP_funcRetrun_t FLASH_WriteHalfPage(UINT32_t Addr, UINT32_t * Data);
TYP_funcRetrun_t FLASH_ReadHalfPage(UINT32_t Addr, UINT32_t * Data);
extern TYP_FlashHalfPage_t FlashHalfBuffer;

#ifdef __cplusplus
}
#endif

#endif /* __I_EEPROM_H */